import Vue from 'vue'
import Router from 'vue-router'
const Home = () => import('@/components/Home')
const Self = () => import('@/components/Self')
const Pame = () => import('@/components/Pame')
const Forum = () => import('@/components/Forum')
const Login = () => import('../fish/Login')
const Regsiter = () => import('../fish/Regsiter')
const Details = () => import('../fish/Details')
const User = () => import('../fish/User')
const Search = () => import('../fish/Search')
const Pal = () => import('../fish/Pal')
const Address = () => import('../fish/Address')
const Order = () => import('../fish/Order')
const Setting = () => import('../fish/Setting')
const Chat = () => import('../fish/Chat')
const Fan = () => import('@/components/Fan')
const Ensh = () => import('@/components/Ensh')
const Used = () => import('@/components/Used')
const Detailed = () => import('@/components/Detailed')
const Xiangzhu = () => import('@/components/Xiangzhu')
const Busin = () => import('@/components/Busin')
const Ask = () => import('@/components/Ask')
const News = () => import('@/components/News')
const ShopHome = () => import('../shop/ShopHome')
// 商城页面
const Classify = () => import('../shop/Classify')
const Cart = () => import('../shop/Cart')
const Sale = () => import('../shop/Sale')
const Inbox = () => import('../shop/Inbox')
const GoodsSort = () => import('../shop/GoodsSort')
const GoodDetail = () => import('../shop/GoodDetail')
const Service = () => import('../shop/Service')
const Return = () => import('../shop/Return')
const ConfirmOrder = () => import('../shop/ConfirmOrder')

const PictureFish = () => import('@/components/PictureFish')
const lookVideo = () => import('@/components/lookVideo')
const text = () => import('../shop/text')
const HeadStart = () => import('@/components/HeadStart')
const Ptgf = () => import('@/components/Ptgf')
const Indetail = () => import('@/components/Indetail')
const Prizedetails = () => import('@/components/Prizedetails')





//视频
const index = () => import('../videos/index')
const VideoDetails = () => import('../videos/VideoDetails')



const particulars = () => import('@/shop/particulars')

// 解决路由跳转地址重复点击的报错问题
const originalPush = Router.prototype.push;
Router.prototype.push = function (location) {
  return originalPush.call(this, location).catch(err => err)
}


Vue.use(Router)
export default new Router({
  mode: 'history',
  routes: [
    // 首页
    // 登录页跳转
    {
      path: '/login',
      name: 'Login',
      component: Login,
    },
    {
      path: '/user',
      name: 'User',
      component: User,
    },
    //注册页跳转
    {
      path: '/reg',
      name: 'Regsiter',
      component: Regsiter,
    },
    // 首页
    {
      path: '/',
      name: '首页',
      component: Home
    },
    {
      path: '/self',
      name: '我的',
      component: Self,
    },
    //论坛
    // 明星钓友
    {
      path: '/pal',
      name: 'Pal',
      component: Pal
    },
    //论坛主页
    {
      path: '/forum',
      name: 'forum',
      component: Forum
    },
    //论坛详情页
    {
      path: '/detail',
      name: 'Details',
      component: Details,
    },
    // 详情页搜索
    {
      path: '/search',
      name: 'Search',
      component: Search,
    },
    // 论坛发帖页
    {
      path: '/pame',
      name: '发帖',
      component: Pame,
    },
    //商城首页
    {
      path: '/shop',
      name: '商城',
      component: ShopHome
    },
    //收货地址
    {
      path: '/inbox',
      name: '收获地址',
      component: Inbox
    },
    // 底部导航栏-地址栏
    {
      path: '/add',
      name: 'Address',
      component: Address,
    },
    //底部导航栏-我的-我的订单页
    {
      path: '/order',
      name: 'Order',
      component: Order,
    },
    //底部导航栏-我的-设置
    {
      path: '/set',
      name: 'Setting',
      component: Setting,
    },
    //底部导航栏-我的--右上角聊天
    {
      path: '/chat',
      name: 'Chat',
      component: Chat
    },
    // 粉丝关注页
    {
      path: '/fan',
      name: '粉丝',
      component: Fan
    },
    // 收藏页
    {
      path: '/fnsh',
      name: '收藏',
      component: Ensh
    },
    // 二手市场
    {
      path: '/used',
      name: '市场',
      component: Used
    },
    // 帖子的详细页
    {
      path: '/detailed',
      name: '详贴',
      component: Detailed
    },
    {
      path: '/chat',
      name: 'Chat',
      component: Chat
    },
    {
      path: '/sale',
      name: 'sale',
      component: Sale
    },
    // 商城一级分类页
    {
      path: '/class',
      name: '分类',
      component: Classify
    },
    //购物车
    {
      path: '/cart',
      name: '购物车',
      component: Cart
    },
    {
      path: '/return',
      name: '退货',
      component: Return
    },
    //商品二级分类页
    {
      path: '/second',
      name: '二级分类',
      component: GoodsSort
    },
    {
      path: '/gooddetail',
      name: '商品详情',
      component: GoodDetail
    },
    // 客户服务页
    {
      path: '/service',
      name: '客服',
      component: Service
    },
    // 主题详细页
    {
      path: '/xiangzhu',
      name: '主祥',
      component: Xiangzhu,
    },
    //评论详情页

    {
      path: '/particulars',
      name: '详情',
      component: particulars
    },
    // 个人 名片
    {
      path: '/busin',
      name: '名片',
      component: Busin
    },
    {
      path: '/conorder',
      name: '确认订单',
      component: ConfirmOrder
    },
    //发布求购页
    {
      path: '/ask',
      name: '求购',
      component: Ask
    },
    {
      path: '/PictureFish',
      name: '钓拍',
      component: PictureFish,
      children: [{
        path: 'lookVideo',
        component: lookVideo
      }]
    },

    //视频 主页面
    {
      path: '/index',
      name: '视频',
      component: index  
    },
    {
      path: '/news',
      name: '二手商品',
      component: News
    },
    {
      path: '/text',
      name: '测试页',
      component: text
    },
    {
      path: '/HeadStart',
      name: '头筹',
      component: HeadStart,
    },

    {
      path: '/Prizedetails',
      name: '头筹详情',
      component: Prizedetails,
    },

    //视频 详情页
    {
      path: '/VideoDetails',
      name: '视频详情',
      component: VideoDetails
    },
    // 钓场
    {
      path: '/ptgf',
      name: '钓场',
      component: Ptgf
    },
    {
      path: '/indetail',
      name: '钓场详情',
      component: Indetail
    }
  ]
})
